package vivo笔试;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

/**
 @author fujiangnan
 @create 2021-09-22-15-04
 @desc ...
 */
public class Main {
    public static int temp = 0;
    public static void main(String[] args) {

        System.out.println(0);

    }

    public static int[] calculateUserList (int[] userIdList, double[] costList, double[] conversionList, double avg_cost) {
        // write code here
        ArrayList<Integer> list = new ArrayList<>();
        int[] ans = new int[2];
        double[] arr = new double[userIdList.length];
        for (int i = 0; i < userIdList.length; i++) {
            arr[i] = costList[i] * conversionList[i];
        }

        HashMap<Integer, Double> map = new HashMap<>();
        for (int i = 0; i < arr.length; i++) {
            map.put(i, arr[i]);
        }
        Arrays.sort(arr);
        double sum = 0;
        double max = 0;
        for (int i = arr.length-1; i>=0; --i) {
            sum += arr[i];
            if (sum < avg_cost) {
                max = Math.max(max, sum);
            }
        }

        return ans;
    }


}
